//
//  ShareManager.m
//  ShoppingMall
//
//  Created by hy002 on 2017/12/26.
//  Copyright © 2017年 HUAYU. All rights reserved.
//

#import "ShareManager.h"
#import "AppDelegate.h"

@implementation ShareManager
+ (id)shareToManager
{
    static dispatch_once_t once_t;
    static ShareManager *manager = nil;
    dispatch_once(&once_t, ^{
        
        manager = [[ShareManager alloc]init];
    });
    return manager;
}

- (instancetype)init
{
    self = [super init];
    if (self) {
        
    }
    return self;
    
}

- (void)shareToType:(int)scene Title:(NSString *)title Description:(NSString *)description ImageUrl:(NSString *)imgUrl WebpageUrl:(NSString *)webUrl
{
    WXMediaMessage *message = [WXMediaMessage message];
    message.title = title;
    message.description = description;
    [message setThumbImage:IMAGE(imgUrl)];
    WXWebpageObject *webpageObject = [WXWebpageObject object];
    webpageObject.webpageUrl = webUrl;
    message.mediaObject = webpageObject;
    SendMessageToWXReq *req = [[SendMessageToWXReq alloc] init];
    req.bText = NO;
    req.message = message;
    req.scene = scene;
    [WXApi sendReq:req];
}
@end
